﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel.DataAnnotations;
using System.Runtime.Serialization;
using Microsoft.Practices.EnterpriseLibrary.Validation.Validators;

namespace Metro.Kashikoi.ServiceContract.Security
{
    [DataContract(IsReference = true)]
    public class User : UserBase
    {
        private string _token;

        [DataMember]
        [StringLength(255, MinimumLength = 1)]
        [StringLengthValidator(1, 255)]
        [Display(Name="First Name")]
        public string FirstName { get; set; }

        [DataMember]
        [StringLength(255, MinimumLength = 1)]
        [StringLengthValidator(1, 255)]
        [Display(Name="Last Name")]
        public string LastName { get; set; }

        [DataMember]
        [Required]
        [DataType(DataType.EmailAddress)]
        [Display(Name = "Email Address")]
        public string EmailAddress { get; set; }

        //[RegularExpression(@"\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*")]
        //[RegexValidator(@"\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*")]

        [DataMember]
        public int CellPhone { get; set; }

        [DataMember]
        public virtual IList<int> GroupIdCol { get; set; }

        #region Constructor
        public User() { }

        public User(string firstName, string lastName, string emailAddress, int cellPhone, string login, string password)
        {
            this.FirstName = firstName;
            this.LastName = lastName;
            this.EmailAddress = emailAddress;
            this.CellPhone = cellPhone;
            this.Login = login;
            this.Password = password;
        }
        #endregion
    }
}
